Skip to content

Conversation

@henryiii
Copy link
Collaborator

@henryiii henryiii commented Apr 26, 2025

Adding a couple of potentially useful build commands:

python -m scikit_build_core.build requires
python -m scikit_build_core.build project-table

"requires" prints out the full build requirements. "project-table" reads the project table, runs dynamic metadata, and then prints the new project table in json form; it may need the requirements installed (which is why I added both commands).

Like the other commands, these are somewhat experimental and subject to change.

Warning/error messages now print to stderr.

@henryiii henryiii force-pushed the henryiii/feat/buildcom branch 3 times, most recently from d70da64 to be5fa18 Compare April 28, 2025 13:50
@henryiii
Copy link
Collaborator Author

Any thoughts on a better name for "metadata"? I don't like that one. It evaluates the dynamic metadata then returns the updated project table in JSON form.

@LecrisUT
Copy link
Collaborator

Any thoughts on a better name for "metadata"? I don't like that one. It evaluates the dynamic metadata then returns the updated project table in JSON form.

For me Metadata would be the PKG-INFO or equivalent. How about pyproject-toml or pyproject-table?

@henryiii henryiii force-pushed the henryiii/feat/buildcom branch from be5fa18 to 5ab29f0 Compare May 1, 2025 05:19
@henryiii henryiii requested a review from Copilot May 1, 2025 05:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces experimental build commands to provide build requirements and dynamic project metadata. Key changes include:

  • Updating tests to capture warnings/errors from stderr instead of stdout.
  • Adding new CLI commands ("requires" and "project-table") in the build module.
  • Enhancing logging functions in the _logging module to allow directing output to a specified file.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_skbuild_settings.py Updated stderr capture in tests for cmake warnings.
tests/test_printouts.py Applied type annotations and added future import for annotations.
tests/test_build_cli.py Added tests for both the build requirements and project metadata commands.
tests/test_broken_fallback.py Updated fallback test to capture stderr output correctly.
src/scikit_build_core/build/main.py Introduced new CLI commands for "requires" and "project-table".
src/scikit_build_core/_logging.py Modified rich_warning and rich_error to enable file specification.
pyproject.toml Extended file patterns to include main.py files.
Comments suppressed due to low confidence (1)

src/scikit_build_core/_logging.py:348

  • Ensure that 'sys' is explicitly imported in this module since sys.stderr is referenced (e.g., in rich_warning and rich_error) to prevent potential NameError issues.
    file: object = None,

@henryiii henryiii merged commit 455756e into main May 1, 2025
64 checks passed
@henryiii henryiii deleted the henryiii/feat/buildcom branch May 1, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants